<template>
    <div>
        <div>
            <el-form ref="form" :model="form" label-width="80px" style="margin-left: 20px">
                <el-form-item label="真实姓名" style="margin-top: 25px">
                    <el-input v-model="form.name" style="width: 150px;" size="small"></el-input>
                </el-form-item>

<!--                <el-form-item label="证件类型">-->
<!--                    <el-select v-model="form.identity" placeholder="请选择证件类型">-->
<!--                        <el-option label="身份证" value="identityCard"></el-option>-->
<!--                        <el-option label="护照" value="passport"></el-option>-->
<!--                        <el-option label="港澳通行证" value="hkmPass"></el-option>-->
<!--                        <el-option label="其他" value="others"></el-option>-->
<!--                    </el-select>-->
<!--                </el-form-item>-->
<!--                <el-form-item label="证件号码">-->
<!--                    <el-input v-model="form.identityNumber" style="width: 350px" size="small"></el-input>-->
<!--                </el-form-item>-->

                <el-form-item label="性别">
                    <el-radio-group v-model="form.sex" >
                        <el-radio label="男"></el-radio>
                        <el-radio label="女"></el-radio>
                    </el-radio-group>
                </el-form-item>

                <el-form-item label="年龄">
                    <el-input v-model="form.age" style="width: 100px" size="small"></el-input>
                </el-form-item>

                <!--<el-form-item label="出生日期">-->
                <!--    <el-col :span="11">-->
                <!--        <el-date-picker type="date" placeholder="选择日期" v-model="form.birth" style="width: 100%; width: 340px"></el-date-picker>-->
                <!--    </el-col>-->
                <!--</el-form-item>-->

                <el-form-item label="居住地址">
                    <el-input v-model="form.loc" style="width: 350px" placeholder="省/市/区/乡(镇)/村/道路、门牌号" size="medium"></el-input>
                </el-form-item>

                <!--<el-form-item label="邮编">-->
                <!--    <el-input v-model="form.postcode" style="width: 350px" size="small"></el-input>-->
                <!--</el-form-item>-->

                <!--<el-form-item label="电子邮箱">-->
                <!--    <el-input v-model="form.mailbox" style="width: 350px" size="small"></el-input>-->
                <!--</el-form-item>-->

                <el-form-item label="手机号码">
                    <el-input v-model="form.phoneNumber" style="width: 350px" size="small"></el-input>
                </el-form-item>

                <el-form-item>
                    <el-button type="primary" @click="onSubmit">保存</el-button>
                    <el-button>关闭</el-button>
                </el-form-item>
            </el-form>
        </div>
<!--        <div>-->
<!--            {{info}}-->
<!--        </div>-->
    </div>
</template>

<script>
    export default {
        data() {
            return {
                form: {
                    name: '',
                    identity: '',
                    identityNumber: '',
                    sex: '',
                    age: '',
                    birth: '',
                    loc: '',
                    postcode: '',
                    mailbox: '',
                    phoneNumber: ''
                },
                // info:''
            }
        },
        mounted() {
            this.$http.get('/user/query').then(response => {
                if (response.data.code === 200) {
                    console.log(response.data)
                    this.form.name=response.data.username
                    this.form.sex=response.data.gender
                    this.form.phoneNumber=response.data.phone
                    this.form.loc=response.data.address
                    this.form.age=response.data.age
                }
            }).catch(err => {
            })

            // this.$axios.get('/').then(response => {
            //     if (response.data) {
            //         console.log(response.data)
            //         this.form.name=response.data.resultcode
            //         this.form.identityNumber=response.data.resultcode
            //     }
            // }).catch(err => {
            //     alert('请求失败')
            // })


        },

        methods: {
            onSubmit() {
                console.log('submit!');
            },

        }
    }
</script>

<style scoped>

</style>